package top.sdwu_top.kbase.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
public enum ApplyStateEnums {

    APPLYING("1", "申请中"),
    REFUSED("2", "已拒绝"),
    PASSED("3", "通过");


    private String key, value;

    ApplyStateEnums(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getName(String key) {
        for (ApplyStateEnums enums: ApplyStateEnums.values()) {
            if (StringUtils.equalsIgnoreCase(key, enums.getKey())) {
                return enums.getValue();
            }
        }
        return null;
    }
}